<template>
    <div>
        <h2>axios二次封装</h2>
        <p><strong>get请求：</strong>{{ text }}</p>
        <test-ref-comp/>
    </div>
</template>
<script>
import { getWeather } from "@/api/index"
import TestRefComp from "components/TestRefComp.vue"
    export default {
        data() {
            return {
               text: ""
            };
        },
        components: {
            TestRefComp
        },
        created() {
            this.getData();
        },
        methods: {
            async getData() {
                const res = await getWeather({
                        city: "深圳",
                        type: "text",
                });
                this.text = res;
            },
        },
    }
</script>